<?php /* Smarty version 2.6.26, created on 2018-07-05 16:54:34
         compiled from D:%5Cwww%5Cvweb/admin%5Ctemplates/album/index.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'uqcms', 'D:\\www\\vweb/admin\\templates/album/index.html', 10, false),array('modifier', 'img_size', 'D:\\www\\vweb/admin\\templates/album/index.html', 36, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index/header.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?> 
<style type="text/css"> 
a.file{ padding:6px 15px; margin-right:10px; overflow:hidden; position: relative; border:1px solid #179ED2; border-radius:0; background:#179ED2; font-size:12px; text-align:center; color:#fff; float:left; }
a.file input{ position:absolute; opacity: 0; right:0; left:0; } 
</style>
<div class="nav"><span>相册列表</span></div> 
<div class="filter">
	<a class="file" href="javascript:;" id="file">文件上传<input type="file" name="imgFile" class="img_file" id="imgFile"/></a> 
	<input type="submit" name="del" class="button" id="del_all" value="删除"/> 
	<?php echo $this->_plugins['function']['uqcms'][0][0]->load_module(array('m' => 'album','v' => 'type_arr','c' => 'path_type_cn'), $this);?>
 
	<select name="type" class="select" id="album_type">
		<option value="" <?php if ($_GET['type'] == ''): ?>selected="selected"<?php endif; ?>>全部图片</option>
		<?php $_from = $this->_tpl_vars['type_arr']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['i']):
?> 
			<option value="<?php echo $this->_tpl_vars['k']; ?>
" <?php if ($_GET['type'] === $this->_tpl_vars['k']): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['i']; ?>
</option>
		<?php endforeach; endif; unset($_from); ?> 
	</select>
</div>
<div class="main"> 
	<table class="ltable">
		<thead>
			<tr>
				<th width="30"><input type="checkbox" class="checked_all"/></th>
				<th width="80">类型</th>
				<th>图片</th>
				<th width="80">大小</th>
				<th width="70">操作</th>
				<th width="110">创建时间</th>
			</tr>
		</thead>
		<tbody>
		<?php if ($this->_tpl_vars['data']['list']): ?>
			<?php $_from = $this->_tpl_vars['data']['list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['i']):
?>
				<tr>
					<td><input type="checkbox" name="id[]" value="<?php echo $this->_tpl_vars['i']['id']; ?>
" class="checked_list"/></td> 
					<td><a href="javascript:;"><?php echo $this->_tpl_vars['i']['type']; ?>
</a></td> 
					<td><a href="<?php echo $this->_tpl_vars['__IMG__']; ?>
<?php echo $this->_tpl_vars['i']['url']; ?>
" target="_blank"><img src="<?php echo $this->_tpl_vars['__IMG__']; ?>
<?php echo ((is_array($_tmp=$this->_tpl_vars['i']['url'])) ? $this->_run_mod_handler('img_size', true, $_tmp, '10000x50') : $this->_plugins['modifier']['img_size'][0][0]->img_size($_tmp, '10000x50')); ?>
"></a></td>
					<td><?php echo $this->_tpl_vars['i']['size']; ?>
</td>
					<td><a href="javascript:;" data-id="<?php echo $this->_tpl_vars['i']['id']; ?>
" class="del">删除</a></td>
					<td><?php echo $this->_tpl_vars['i']['addtime']; ?>
</td>
				</tr>
			<?php endforeach; endif; unset($_from); ?> 
		<?php else: ?>
			<tr><td colspan="6">还没有数据，赶快添加吧！</td></tr>
		<?php endif; ?>
		</tbody>
	</table>
	<?php if ($this->_tpl_vars['data']['page']): ?><div class="page"><?php echo $this->_tpl_vars['data']['page']; ?>
</div><?php endif; ?>
</div>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index/footer.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?> 
<script type="text/javascript" src="<?php echo $this->_tpl_vars['__PUBLIC__']; ?>
js/ajaxfileupload.js"></script>
<script type="text/javascript">
_delete('?m=album&a=del', '#del_all');
// 上传
$(function(){
	$(document).on('change','#imgFile',function(){ 
		var $this=$(this); 
		$("#upload_msg").ajaxStart(function(){ 
			$(this).show(); 
		});
		$.ajaxFileUpload({ 
			url:'?m=album&a=upload&path=temp',
			secureuri:false, 
			fileElementId:'imgFile',
			dataType: 'text',	//text json
			success: function(result){
				data = jQuery.parseJSON(result);
				if(data.error == '0'){
					parent.$.alert('保存成功');
					location.reload();
				}else{
					parent.alert(data.msg);
				} 
			}
		});
	});
});

// 下拉菜单
$("#album_type").change(function(){
	type_id = $(this).children('option:selected').val();  
	location.href="?m=album&type="+type_id;
});
</script>